<?php/* * Created on Jun 4, 2009 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */require_once ('Dao.php');require_once ('model/story.php');class TopStoriesLoader extends Dao{	const GET_TOP_STORIES_SQL = "select STORY_ID, STORY_TITLE, SHORT_TEXT, DATED, AUTHOR from STORIES ORDER BY DATED DESC LIMIT 10";	function getTopStories()	{		$stmt = $this->mysqli->prepare(self :: GET_TOP_STORIES_SQL);		$stmt->execute();		$storyId = null;		$storyTitle = null;		$shortText = null;		$dated = null;		$author = null;		$stmt->bind_result($storyId, $storyTitle, $shortText, $dated, $author);		$content = array ();		$index = 0;		$returnText = null;		$stories = array();		while ($stmt->fetch())		{			$story = new Story($storyId, $storyTitle, $dated, $author, $shortText, "");			$stories[$storyId] = $story;		}		return $stories;	}}?>
